package com.sanjiahantang.ythshopping.model;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zy on 2017/8/26.
 */

public class MainNearByPageData {
    private List<Cat> cats;
    private List<RecommenShop> recommen_shops;
    private List<NearShop> near_shops;
    private String area;

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public List<Cat> getCats() {
        return cats;
    }

    public void setCats(List<Cat> cats) {
        this.cats = cats;
    }

    public List<RecommenShop> getRecommen_shops() {
        return recommen_shops;
    }

    public void setRecommen_shops(List<RecommenShop> recommen_shops) {
        this.recommen_shops = recommen_shops;
    }

    public List<NearShop> getNear_shops() {
        return near_shops;
    }

    public void setNear_shops(List<NearShop> near_shops) {
        this.near_shops = near_shops;
    }

    public List<Menu> getMenu(){
        List<Menu> menus = new ArrayList<>();
        for (Cat cat:cats) {
            Menu item = new Menu();
            item.setMenu_img(cat.getCat_img());
            item.setMenu_name(cat.getCat_name());
            item.setMenu_url(cat.getCat_url());
            item.setId(0);
            menus.add(item);
        }
        return menus;
    }

    public List<NearbyShop.ShopList> getShop(){
        List<NearbyShop.ShopList> shops = new ArrayList<>();
        if (recommen_shops == null){
            return shops;
        }
        for (RecommenShop rs:recommen_shops) {
            NearbyShop.ShopList item = new NearbyShop.ShopList();

            item.setShop_name(rs.getShop_name());
            item.setShop_img(rs.getShop_img());
            item.setShop_url(rs.getShop_url());
            shops.add(item);
        }
        return shops;
    }
}
